<{capture name="header"}>
<{lang_script src="lang.js" app='b2c'}>
<{script src="coms/pager.js" app='desktop'}>
<{/capture}>
<script>


var goodsEditFrame = (function(){


    /******************************************/
        /*
         *  sign:{
               1:保存并增加相似商品,
               2:保存并返回,
               3:保存当前不返回，
         *    }
         */
   var _form=$('gEditor'),_formActionURL=_form.get('action');

   subShopinfoForm = function (event,sign){
        var _default_disabled_bn = false;
       $$('.class-bn').each(function(item,index){
          if($(item).get('disabled')) {
            _default_disabled_bn = true;
            $(item).set('disabled', false);
          }
       });



    switch (sign){
            case 1:
            
            var target={
                    onComplete:function(){
                        location.reload();
                         if( _default_disabled_bn ) {
                          $$('.class-bn').set('disabled', true);
                        }
                       
                }};
            break;
            case 2:
            var target={
                    onComplete:function(rs){
                        if(JSON.decode(rs).error) {
                            return ;
                        }
                        if(window.opener.finderGroup&&window.opener.finderGroup['<{$env.get.finder_id}>']){
                            window.opener.finderGroup['<{$env.get.finder_id}>'].refresh();
                        }
                        window.close();
                        if( _default_disabled_bn ) {
                          $$('.class-bn').set('disabled', true);
                        }

                    }};
            break;
            case 3:
            var target={           //保存当前
                    onComplete:function(rs){
                        var id = JSON.decode(rs).store_id;
                        if(id > 0){
                            $('newshopinfo-edit-form-GId-input').value =id;
                            $('gEditor-g-type').value ='edit';
                            if( _default_disabled_bn ) {
                            $$('.class-bn').set('disabled', true);
                                }
                          
                        }
                      
                    }};
            break;
       }

     
       _form.store('target',target);
       _form.fireEvent('submit',new Event(event));
      

   };
});

goodsEditFrame();

</script>
<form name="gEditor" id="gEditor" method='post'  action="index.php?app=complain&ctl=admin_complain&act=toAdd">
<input name="__type" value="<{$complain.complain_id ? 'edit' : 'add'}>" id="gEditor-g-type" type="hidden">
<div class="tableform">
    <div class="division">
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr><th style="width:10%;"><em class="red">*</em><{t}>订单：<{/t}></th>
            <input  name="complain[complain_id]" value="<{$complain.complain_id}>" id="newshopinfo-edit-form-GId-input" type="hidden" value=$complain.complain_id>
            <td>
            <{input type="object" vtype="required" object="orders@b2c" filter='disabled=false' value=$complain.order_id  name="complain[order_id]"}> 
            &nbsp; <{help}><{t}>此处请选择要投诉的订单。<{/t}><{/help}>
            </td>
            </tr>
            <tr><th style="width:10%;"><em class="red">*</em><{t}>投诉类型：<{/t}></th>
            <td>
                <label style="margin-right: 10px;"><input type="radio" value="after" checked=checked class="J_ReasonId" name="complain[reason]">售后问题</label>
                <label style="margin-right: 10px;"><input type="radio" value="action" class="J_ReasonId" name="complain[reason]">行为违规</label>
            </td>

            <td>
            </td>
            </tr>
            <tr><th style="width:10%;"><em class="red">*</em><{t}>投诉者：<{/t}></th>
            <td>
            <{input type="object" vtype="required" object="members@b2c" filter=$memberfilter value=$complain.from_member_id  name="complain[from_member_id]" textcol="login_name@account@pam" cols="name"}> 
            </td>
            </tr>
            <tr><th style="width:10%;"><em class="red">*</em><{t}>投诉者手机：<{/t}></th>
            <td>       
             <{input  type='text' vtype="required&&mobile" id=mobile name="complain[mobile]" value=$complain.mobile}>
            </td>
            </tr>
            <tr><th style="width:10%;"><em class="red">*</em><{t}>投诉者留言：<{/t}></th>
            <td>
            <{input type="textarea" vtype="required"  name="complain[memo]" cols=25 rows=2 }> 
            </td>
            </tr>
            <tr><th style="width:10%;"><{t}>举证一：<{/t}></th>
            <td>
             <{input type='image' name='complain[image_0]' width=200 height=150 value=$complain.image_0}>
            </td>
            </tr>
             <tr><th style="width:10%;"><{t}>举证二：<{/t}></th>
            <td>
             <{input type='image' name='complain[image_1]' width=200 height=150 value=$complain.image_1}>
            </td>
            </tr>
            <tr><th style="width:10%;"><{t}>举证三：<{/t}></th>
            <td>
             <{input type='image' name='complain[image_2]' width=200 height=150 value=$complain.image_2}>
            </td>
            </tr>
        </table>
    </div>
</div>
<{capture name="footbar"}>
<table cellspacing="0" cellpadding="0" class="table-action">
      <tbody>
        <tr valign="middle">
        <td>
            <{button label=$___b2c="保存并关闭"|t:'b2c' class="btn-primary" onclick="subShopinfoForm(event,2)"}>
            <{if !$complain.complain_id}>
            <{button label=$___b2c="保存并添加相似"|t:'b2c' class="btn-primary" onclick="subShopinfoForm(event,1)"}>
            <{/if}>
            <{button label=$___b2c="保存当前"|t:'b2c' class="btn-primary" onclick="subShopinfoForm(event,3)"}>
            <{assign var=bcclose value=$___b2c='确定退出?'|t:'b2c'}>
            <{assign var=bclose value="关  闭"}>
            <{button label=$___b2c=$bclose|t:'b2c' class="btn-secondary" onclick="if(confirm('{$bcclose}'))window.close()"}>
        </td>
        </tr>
        </tbody>
</table>
<{/capture}>
</form>









